<?php
define('IN_CORE', true);
error_reporting(0);
date_default_timezone_set('PRC');
//header('Access-Control-Allow-Origin:http://www.test.com'); //指定域名跨域
header('Access-Control-Allow-Origin:*');//任何
define('ROOT_PATH', dirname(__FILE__));
define('INC_PATH', '../application/appsctrols');
define('APP_INC_PATH', '../application');
define('SITE_URL','http://bltzdb.test.com');
define('WEB_PATH',SITE_URL.'/api');
define('M_SITE_URL',SITE_URL);
define('W_WEB_PATH',SITE_URL.'/?');//分享用
define('G_WEB_PATH', SITE_URL.'/uploads');
define('ADVER_WEB_PATH',SITE_URL);
define('G_IN_SYSTEM', true);
require_once ROOT_PATH.'/core/core.php';
//定义当前请求的系统常量
define('G_CHARSET', 'utf-8');
define('NOW_TIME',      $_SERVER['REQUEST_TIME']);
define('REQUEST_METHOD',$_SERVER['REQUEST_METHOD']);
define('IS_GET',        REQUEST_METHOD =='GET' ? true : false);
define('IS_POST',       REQUEST_METHOD =='POST' ? true : false);
define('IS_PUT',        REQUEST_METHOD =='PUT' ? true : false);
define('IS_DELETE',     REQUEST_METHOD =='DELETE' ? true : false);
define('IS_AJAX',       ((isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') || !empty($_POST[C('VAR_AJAX_SUBMIT')]) || !empty($_GET[C('VAR_AJAX_SUBMIT')])) ? true : false);
$sysConfig = require_once '../application/config/system.inc.php';
define('GOODS_END_TIME', intval($sysConfig['goods_end_time']));
$ip_str = $sysConfig['web_off_ip'];
if (!empty($ip_str)){
	$ip_arr = explode('|', $ip_str);
	$clientIP = get_client_ip();
	if (in_array($clientIP, $ip_arr)){
		exit;
	}
}
require_once './api.php';
api::getInstance()->init(); //启动